package com.dianxin.smartpark.service.config;

public enum MqttTopicType {
    /**
     * 操作类型
     */
    ACCESSCONTROL("facedoor","门禁"),
    CARBRAKE("park_controller","车牌");


    private final String topicNmae;
    private final String topicCode;


    MqttTopicType(String topicCode, String topicNmae) {
        this.topicNmae = topicNmae;
        this.topicCode = topicCode;
    }

    public String getTopicNmae() {
        return topicNmae;
    }

    public String getTopicCode() {
        return topicCode;
    }

    public static String mqttOptType(String topicNmae) {
        if (topicNmae == null) {
            return null;
        }
        for (MqttTopicType value : MqttTopicType.values()) {

            if (value.topicNmae.equals(topicNmae)) {
                return value.topicCode;
            }
        }
        return null;
    }


}
